package cn.edu.scau.cmi.chenbingquan.simpleFactoryMethod;

import cn.edu.scau.cmi.chenbingquan.simpleFactoryMethod.domain.Beef;
import cn.edu.scau.cmi.chenbingquan.simpleFactoryMethod.domain.Chicken;
import cn.edu.scau.cmi.chenbingquan.simpleFactoryMethod.domain.Meat;
import cn.edu.scau.cmi.chenbingquan.simpleFactoryMethod.domain.Pork;

// 肉类工厂
public class MeatFactory {
	
	// 产生肉类
	public static Meat getMeat(String type) {
		Meat meat = null;
		
		switch(type) {
			case "beef": 
				meat = new Beef();
				break;
			case "chicken":
				meat = new Chicken();
				break;
			case "pork":
				meat = new Pork();
				break;
		}
		return meat;
	}
}
